package com.pace.ribbon.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@ConfigurationProperties(prefix="my.config")
// 该注解可读取自定义配置文件,
// prefix可指定配置项前缀
@Component
//标记该类为spring的一个组件
public class Myconfig {

    // 读取开关
    @Value("${switch.allSwitch}")
    private  String allSwitch;

    private  String name;
    private  String value;

    public String getAllSwitch() {
        return allSwitch;
    }

    public void setAllSwitch(String allSwitch) {
        this.allSwitch = allSwitch;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
